"use strict";

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = (app) => {
    const { router, controller } = app;
    // 欢迎页
    router.get("/", controller.home.index);

    // 登陆接口
    router.post("/login", controller.home.login);

    // 验证码相关
    router.get("/code/:mobile", controller.code.create);

    // 角色相关
    router.get("/roles", controller.role.index);
    router.post("/roles", controller.role.create);

    // 用户相关
    router.post("/users", controller.user.create);
    router.get("/users", controller.user.index);
    router.delete("/users", controller.user.delete);

    // 部门相关
    router.get("/depts", controller.dept.index);
    router.post("/depts", controller.dept.create);

    // 权限相关
    router.get("/acls", controller.acl.index);
};
